package edu.hubu.store.dao;


import edu.hubu.store.domain.Order;
import edu.hubu.store.domain.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
@Mapper
public interface OrderItemDao {

	/**
	 * 添加订单项
	 * @param orderItem
	 */
	public void addOrderItem(@Param("order") OrderItem orderItem);

	/**
	 * 根据订单查找订单项.并将订单项中商品查找到。
	 * @param order
	 * @return
	 */
	public List<OrderItem> findOrderItemByOrder(@Param("order") Order order);

	/**
	 * 根据订单id删除订单项
	 * @param id
	 */
	public void delOrderItems(String id);

}
